package com.chushouya.manager.constants;


import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 消息级别(1日常通知/2重要通知)
 */
public enum NoticeLevelEnum implements IEnum<Integer> {

    common(1, "日常通知"),
    important(2, "重要通知")
    ;

    private Integer value;

    private String desc;

    NoticeLevelEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer type) {
        for (NoticeLevelEnum thisEnum : NoticeLevelEnum.values()) {
            if (Objects.equals(thisEnum.value, type)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
